Support deleting whole partitions in Iceberg table#21048
Support deleting whole partitions in Iceberg table#21048hantangwangd merged 1 commit intoprestodb:masterfrom
Conversation
ZacBlanco
left a comment
There was a problem hiding this comment.
My main concern is about semantics of delete with snapshots/partition evolution. It's not clear to me how exactly this is handled. Also, we should probably update the docs. Looks good otherwise though!!
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/test/java/com/facebook/presto/iceberg/IcebergDistributedTestBase.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
ZacBlanco
left a comment
There was a problem hiding this comment.
Looks good! Mostly just small nits now. I think we should also update the docs to specify this is now supported and limited to partition-only and without specific snapshots
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergTableHandle.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/optimizer/IcebergPlanOptimizer.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/util/GraphvizPrinter.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 384aca5...6fcc0eb.
|
Fixes are done, and iceberg doc is updated. Please take a look. |
ZacBlanco
left a comment
There was a problem hiding this comment.
Two minor grammatical suggestions on the docs, but @steveburnett might have better ones. Otherwise LGTM!
@ZacBlanco Thanks a lot, I will squash them into one commit later. |
steveburnett
left a comment
There was a problem hiding this comment.
Nice work! I made a couple of suggestions for consistency and clarity.
There was a problem hiding this comment.
Latin such as etc., e.g, i.e, should be avoided. For an example of a standard for this, see the GitLab recommended word list entry for etc.. To address this adapting @ZacBlanco's suggestion, consider something like this.
| Do not support non-comparison operator for the filter columns, for example ADD, SUBTRACT, MODULUS, etc. | |
| Filtered columns only support comparison operators, such as EQUALS, LESS THAN, or LESS THAN EQUALS. |
@steveburnett Thanks a lot. I have update the docs following your suggestion, and squash them into one commit. Please take a look. |
steveburnett
left a comment
There was a problem hiding this comment.
LGTM! (docs)
Updated my local branch just now and built the docs locally to pick up and review the latest changes as they will be seen in production, everything looks great.
ChunxuTang
left a comment
There was a problem hiding this comment.
@hantangwangd Thanks for your work! This is a nice feature that would benefit the connector users.
Just left some minor comments.
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergTableHandle.java
Outdated
Show resolved
Hide resolved
presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergAbstractMetadata.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/util/GraphvizPrinter.java
Outdated
Show resolved
Hide resolved
|
@hantangwangd BTW, do you want to add a release note? |
@ChunxuTang Sure, release note have been added. |
We can use 'delete from <table> [where <predicate>]' to delete whole partitions or all data in Iceberg table. The predicate should satisfy some requirements: - The columns appeared in predicate should all be identity partitioned columns, that is, use their original value as partition value. - The columns appeared in predicate should not be wrapped in a non-comparison operator(for example ADD, SUBTRACT, MODULUS etc.) Co-authored-by: Zac Blanco <zac@ibm.com> Co-authored-by: Steve Burnett <burnett@pobox.com>
presto-main/src/main/java/com/facebook/presto/util/GraphvizPrinter.java
Outdated
Show resolved
Hide resolved
|
Re-running the failed test. |
@ChunxuTang It's my pleasure. |
Description
We can use
delete from <table> [where <predicate>];to delete one or more whole partitions or all data in Iceberg table when some conditions are met:Motivation and Context
This PR allows deleting partition level data from Iceberg tables.
Test Plan
Contributor checklist
Release Notes